package com.jeff.springWebTestNG.infinispan.interceptors;

import org.infinispan.commands.VisitableCommand;
import org.infinispan.context.Flag;
import org.infinispan.context.InvocationContext;
import org.infinispan.interceptors.base.CommandInterceptor;

public class CustomInterceptor1 extends CommandInterceptor {
	private String attributeOne;
	private String attributeTwo;
	
	public CustomInterceptor1() {}
	
	public String getAttributeOne() {
		return attributeOne;
	}
	public void setAttributeOne(String attributeOne) {
		this.attributeOne = attributeOne;
	}
	public String getAttributeTwo() {
		return attributeTwo;
	}
	public void setAttributeTwo(String attributeTwo) {
		this.attributeTwo = attributeTwo;
	}
	
	@Override
	protected Object handleDefault(InvocationContext ctx,
			VisitableCommand command) throws Throwable {
		// TODO Auto-generated method stub
		System.out.println("Operation has flag? " + ctx.hasFlag(Flag.SKIP_LOCKING));
		System.out.println(attributeOne);
		return super.handleDefault(ctx, command);
	}
}
